<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>多页面导航中心</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Arial', sans-serif;
        }

        body {
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            transition: background-image 0.5s ease;
        }

        .upload-container {
            position: fixed;
            top: 20px;
            left: 20px;
            z-index: 1000;
        }

        .upload-btn {
            padding: 10px 15px;
            background: rgba(255, 255, 255, 0.8);
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-weight: bold;
        }

        .upload-btn:hover {
            background: rgba(255, 255, 255, 1);
        }

        #bgInput {
            display: none;
        }

        .nav-container {
            text-align: center;
            background: transparent; /* 完全透明背景 */
            padding: 30px;
            border-radius: 15px;
            max-width: 800px;
            width: 90%;
        }

        h1 {
            margin-bottom: 30px;
            color: #fff; /* 白色文字 */
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* 文字阴影增强可读性 */
        }

        .nav-links {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 20px;
        }

        .nav-item {
            text-decoration: none;
            color: #fff;
            padding: 15px;
            border-radius: 8px;
            display: block;
            transition: all 0.3s ease;
            font-weight: bold;
            background: rgba(0, 0, 0, 0.5); /* 半透明黑色背景（按钮） */
        }

        .nav-item:hover {
            background: rgba(0, 0, 0, 0.7); /* 悬停时加深背景色 */
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }
    </style>
</head>
<body>

    <!-- 导航容器 -->
    <div class="nav-container">
        <div class="nav-links">
            <a href="/1.html" class="nav-item page1">爱心红</a>
            <a href="/2.html" class="nav-item page2">代码表达爱</a>
            <a href="/3.html" class="nav-item page3">流星爱心</a>
            <a href="/4.html" class="nav-item page4">红色爱心变换</a>
            <a href="/5.html" class="nav-item page6">星球</a>
            <a href="/6.html" class="nav-item page7">love掉落黑客风</a>
            <a href="/7.html" class="nav-item page8">爱心飘零</a>
            <a href="/8.html" class="nav-item page9">爱心树</a>
        </div>
    </div>

    <script>
        // 初始化背景（从localStorage或默认值）
        document.addEventListener('DOMContentLoaded', () => {
            const body = document.body;
            const bgInput = document.getElementById('bgInput');
            const uploadBg = document.getElementById('uploadBg');

            body.style.backgroundImage = "url('/image/5.jpg')"; // 替换为你的默认背景URL

            // 背景图片上传功能
            uploadBg.addEventListener('click', () => {
                bgInput.click();
            });

            bgInput.addEventListener('change', (e) => {
                const file = e.target.files[0];
                if (file) {
                    const reader = new FileReader();
                    reader.onload = (event) => {
                        const bgUrl = event.target.result;
                        body.style.backgroundImage = `url(${bgUrl})`;
                        localStorage.setItem('customBackground', bgUrl); // 保存到localStorage
                    };
                    reader.readAsDataURL(file);
                }
            });
        });
    </script>

    <footer class="footer">
    <p>版权所有 © 2025 jyz</p>
    </footer>
</body>
</html>

